package com.zheng.servlet;

import com.zheng.http.Request;
import com.zheng.http.Response;

/**
 *  @author: zheng
 *  @Date: 2020-06-23 14:39
 *  @Description:
 */
public abstract  class HttpServlet implements Servlet {

    public abstract void doGet(Request request, Response response);

    public abstract void doPost(Request request,Response response);


    @Override
    public void service(Request request, Response response)  {
        if("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request,response);
        }else{
            doPost(request,response);
        }
    }
}
